home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Precision Software Appli…tions Silver Collection 1
/
Precision Software Applications Silver Collection Volume One (PSM) (1993).iso
/
windows
/
games
/
circlesq.arj
/
CIRCLSQ3.DOC
< prev
next >
Wrap
Text File
|
1987-09-09
|
9KB
|
154 lines
CIRCLESQ.EXE -- "Pretty Wallpaper" program for Microsoft (tm) Windows
(c) Copyright 1987 -- Doren Kim Levitt
Version 3.00 -- 9/9/1987
(Based on an algorithm devised by John E. Connett of University of
Minnesota as published in Scientific American - September 1986)
This program is a little something I whipped up to test Windows' device
independence and also to get a handle (he he) on learning to do bit
map graphics under Windows..
When I did the original version for Windows v1.03, I got a rude awakening
when I discovered that although I could use a "memory bitmap" to contain
a copy of a full screen display for a monochrome screen, on the color
version it produced garbage when a bitblt was attempted.. After reading
of the limitations of EGA and other color systems under Windows v1.03, I
decided to postpone the problem until Windows 2.00 when it would hopefully
be fixed. So I put in a "kludge" that precluded the use of a memory bitmap
with color systems.. This meant that any window resizing or repainting re-
quired a recomputation of the screen values..
Now that Windows v2.00 is coming out (any day now), the good news is they
fixed the bugs! Now you can have full-screen memory bitmaps and there is
also support for 8087 use. My new version (3.00) of CIRCLESQ uses both of
these new features and therefore works a lot better than the old one.
In a future version, I plan on implementing a "File" menu with functions
to permit reading of pre-computed arrays of data and also writing of
arrays after computation to memory and disk.
NOTE that the earlier version for Windows v1.03 is named CIRCLSQ2.EXE.
You can run this one under Windows v1.0x or Windows v2.00, but it doesn't
have the "Edit" menu functions implemented and in the color version, the
window cannot be resized or repainted without causing a re-computation of
the entire screen. The new version, (named CIRCLSQ3.EXE) is for Windows
v2.00 and up systems ONLY. Do NOT attempt to run it on earlier versions
of Windows, it will CRASH your system.
The CIRCLSQ2 version has a few known "bugs" (and probably lots more I
haven't found yet):
1) You cannot bring up the "About..." or "Setup" dialog boxes
during a screen painting. (If you attempt this, the dialog
box will not appear until the screen is completely plotted.)
On color systems, if a portion of the window that has been
painted is covered by a dialog box or popup windows, when the
dialog box or popup goes away, a hole will be left.. Part of
this is due to the "kludge". (It's fixed in the new version.)
2) The window caption bar will appear on a window in full screen
mode that has been "de-zoomed" and has been "Alt-tabbed" or
"clicked in" as an "active" task after running as an "inactive"
task. (This is because Windows insists on updating the caption
bar even when "full-screen" mode is enabled.) Since normally
full screen mode isn't used when a window is tiled, this is
not usually a problem.. (A "full-screen" mode tiled window is
kind of interesting, however.. You can tile a screen with a
bunch of "full-screen" windows and get interesting effects..
See my "Flasher" program for another Windows application that
uses "full-screen" mode.) (This problem is fixed somewhat
better in the new version, but under some cases, you can get
the frame drawn in there and the program will paint over it.)
3) It's SLOW (8087 support helps a lot here, it's not possible
under Windows v1.0x, upgrade to Windows v2.00 and run the
new version which DOES use the 8087.)
4) The "Edit" menu is non-functional. (It's implemented in the
new version.)
The new version (CIRCLSQ3) has no known bugs. (Let me know if you find
any...) There are two limitations, however: When using the "Edit" function
in full-screen mode, you cannot "Mark" any "non-client" areas of the
window (the invisible border, menu bar, title bar, control menu box and
sizing boxes) even though there are painted. Switch out of full screen
mode and the image will move into the client area. Also, when you are
"Marking" an area of the screen, once you have pressed the button, you
are "locked" into the client area (until you release the mouse button).
If you use the keyboard to move or iconize the window, your cursor may
remain trapped. Move the window back (using the keyboard if necessary)
and then click the mouse button and you will be freed. (I might have been
able to put in a trap for this kind of move, but no normal human would
ever try such a thing, right? Only a mad programmer bent on finding a
bug... So I will classify this as a FEATURE, not a bug...)
Note that when using the "Full Screen" mode, the drop down menus can
still be accessed either with the mouse (if you point and click in the
right spot) or via function keys.. (Neat huh?)
The new version of CIRCLESQ also demonstrates the new 8087 and large
bitmap support under Windows v2.00. They finally fixed the memory
bitmaps to permit memory storage of large color bitmaps. This allows
the Windows v2.00 version to save the entire screen image in memory
so the window can be re-sized or moved without required a recomputation
of screen pixel color values. Unfortunately, the memory required to
save a full-color, full-screen image is quite a bit, so CIRCLSQ3 is
a memory pig.. Under Windows v2.00, however, if you have "EMS" or
"EEMS" expanded memory in your system (or extended emulating expanded)
you can get a "EMS v4.0" driver for your board and Windows will use
the extra memory. It comes in handy for programs like this.
If your system has an 8087 or 80287 or 80387, when you run the new
version, CIRCLSQ3 will use it to speed calculations. Whether you have
one or not, CIRCLSQ3 will cause Windows to look for a WIN87EM.EXE file,
which should be in your Windows directory or on the search path.
Since this program computes a value for each pixel it is VERY VERY SLOW...
Plan on drinking coffee while it runs. If you have patience, however,
this program will produce some very colorful and beautiful pictures..
Try the default values to start and then move the viewport size up and
down as you wish.. (If you have a few hours to kill or a 386/80387.)
To use the "Edit" menu functions, select "Mark", then move the cursor
over the screen, click at one of the corners of a rectangle you wish to
cut and then drag the mouse (with the button depressed) to an opposite
corner and release the button. The area you select will be displayed in
reverse colors. You can then use the "Copy" option to copy the selected
section of the display to the clipboard. It will show up there as a
color bitmap. You can then paste the image from the clipboard, but in
Windows Write and Paint, the color bitmap is converted to monochrome.
Windows Draw! and In-A-Vision don't support color bitmaps (they are
metafile editors), but PC Paintbrush for Windows WILL support color
bitmaps.
This program uses GetDeviceCaps calls to determine the resolution and
number of colors on your display and uses this information in plotting
the pixels on the screen.. Read the Scientific American article for
info on the algorithm used to plot.
I would appreciate any feedback. Let me know if you liked it or not or
what you would like to see changed or if you found any interesting bugs..
I may release the source later if anyone is interested and after I clean
it up some.. I originally wrote this program in Turbo Pascal, by the way,
then translated to "plain-vanilla" C (under DOS) then to Windows v1.00 and
now to Windows v2.00.. It may not be a very useful program, but it is
"pretty" and it has (and still is) providing me with a good program to
"play with" so I can learn how to write for Windows. I could probably keep
adding features until I have tried everything in the book.. (he he)..
If you liked this program so much you'd like to send a donation to me,
that would be nifty.. (Make checks payable to: Micro Bulletin Board
Systems and send to: MBBS; 8033 Sunset Blvd., #975; Los Angeles, CA 90046)
You can address feedback to me via my BBS system (number below). Leave a
message on log off using "COMMENTS" at the CP/M prompt (yes, CP/M still
lives).. (My MBBS runs on an old Kaypro II Z80/ZCPR3 based system. I
use an AT&T PC6300 for development work.)
-- Kim Levitt, sysop
MBBS HQ PDSE
(213) 653-6398 (300/1200/2400)
(24 hrs, 7 days/week BBS system)